package com.xbrother.config;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * mybatisPlus 配置
 *
 * @author huangchangjin
 * @date 2025/4/24 16:37
 */
@MapperScan(value = {"com.xbrother.lucene.dao"})
@Configuration
public class MybatisPlusConfig {
    @Bean
    public MybatisPlusInterceptor paginationInterceptor() {
        MybatisPlusInterceptor p = new MybatisPlusInterceptor();
        PaginationInnerInterceptor page = new PaginationInnerInterceptor();
        p.addInnerInterceptor(page);
        page.setOverflow(false);
        page.setMaxLimit(-1L);
        return p;
    }
}
